package com.rul.mars.order.controller;

import com.rul.mars.common.api.CommonResult;
import com.rul.mars.mbg.domain.CommentReplayParam;
import com.rul.mars.order.service.CommentReplayService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 商家回复评论服务接口
 *
 * @author RuL
 */
@Api(tags = "MerchantCommentReplayController", description = "商家回复评论服务接口")
@RestController
@RequestMapping("/merchant/comment")
public class MerchantCommentReplayController {

    @Autowired
    private CommentReplayService commentReplayService;

    /**
     * 回复评论
     *
     * @param param 回复评论参数
     * @return 回复结果
     */
    @PostMapping("/replay")
    public CommonResult replay(@RequestBody CommentReplayParam param) {
        boolean success = commentReplayService.replay(param);
        if (success) {
            return CommonResult.success();
        }
        return CommonResult.failed();
    }

}
